#define _CRT_SECURE_NO_WARNINGS 1
#include"SL.h"

void Test()
{
	STNode* plist = InitST();
	PushFront(plist, 1);
	PushFront(plist, 2);
	PushFront(plist, 3);
	PushFront(plist, 4);
	PushBack(plist, 10);
	PushBack(plist, 20);
	PushBack(plist, 30);
	PushBack(plist, 40);
	Print(plist);
	PopFront(plist);
	PopFront(plist);
	Print(plist);
	PopBack(plist);
	Print(plist);
	PopBack(plist);
	PopBack(plist);
	PopBack(plist); 
	PopBack(plist);
	PopBack(plist);
	Print(plist);
}

void Test2()
{
	STNode* plist = InitST();
	PushFront(plist, 1);
	PushFront(plist, 2);
	PushFront(plist, 3);
	PushFront(plist, 4);
	PushBack(plist, 10);
	PushBack(plist, 20);
	PushBack(plist, 30);
	PushBack(plist, 40);
	Print(plist);
	STNode* pos = Find(plist,30);
	if (pos != NULL)
	{
		Insert(pos, 300);
		Print(plist);
	}
	pos = Find(plist, 30);
	if (pos != NULL)
	{
		Erase(pos);
		Print(plist);
	}
	Destory(plist);
	plist = NULL;
	Print(plist);
}
int main()
{
	//Test();
	Test2();
}